<template>
  <div id="app">
    <transition name="fade">
      <router-view/>
    </transition>
    
  </div>
</template>

<script>

export default {
  name: 'App',
  mounted() {
    this.initMap()
  },
  methods: {
    async initMap() {
  
        let _this=this;
        let areaKey=''
        let geolocation = new BMap.Geolocation();  
        let gc = new BMap.Geocoder(); 
        await geolocation.getCurrentPosition( (r)=>{
            let pt = r.point; //获取当前ip的经纬度 
            gc.getLocation(pt, function(rs){  
            let addComp = rs.addressComponents;  
          //   for(let p in areaJson.county_list){
          //   if(areaJson.county_list[p]==addComp.district){
          //     areaKey=p;
          //     break;
          //   }
          // } 
            _this.$bus.mapResult=rs
            // _this.area = [addComp.province,addComp.city,addComp.district,areaKey];
        });
        })
         

      },
  },
}
</script>

<style lang="scss">
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin:0;
  padding:0;
}
/*动画*/
.fade-enter-active {
  transition: opacity 1.5s;
}
.fade-enter {
  opacity: 0;
}


</style>
